Revert to non-xinerama mode when XineramaQueryScreens returns NULL; patch
authorLoïc Minier <lool@dooz.org>
Tue, 3 Apr 2007 13:48:26 +0000 (13:48 +0000)
committerLoic Minier <lminier@src.gnome.org>
Tue, 3 Apr 2007 13:48:26 +0000 (13:48 +0000)
2007-04-03  Loïc Minier  <lool@dooz.org>

* gdk/x11/gdkscreen-x11.c: (check_xfree_xinerama): Revert to
non-xinerama mode when XineramaQueryScreens returns NULL; patch from
Simon McVittie; #425786.

svn path=/trunk/; revision=17579

ChangeLog
gdk/x11/gdkscreen-x11.c

index be92a8285222c970cbe92128c2ed9a894a2e6c36..559a7c0a8e0b2b43b76e42e578dfec26dc144381 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-03  Loïc Minier  <lool@dooz.org>
+
+       * gdk/x11/gdkscreen-x11.c: (check_xfree_xinerama): Revert to
+       non-xinerama mode when XineramaQueryScreens returns NULL; patch from
+       Simon McVittie; #425786.
+
 2007-04-02  Michael Natterer  <mitch@imendio.com>
 
        * gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): remove
index eb37af139337860bd633277dfd8d3f63e3b7bf76..f5e08d87ae41f52b74b300ced53fe16aaa2d3eae 100644 (file)
@@ -600,12 +600,16 @@ check_xfree_xinerama (GdkScreen *screen)
       GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
       XineramaScreenInfo *monitors = XineramaQueryScreens (GDK_SCREEN_XDISPLAY (screen),
                                                           &screen_x11->num_monitors);
-      if (screen_x11->num_monitors <= 0)
+      if (screen_x11->num_monitors <= 0 || monitors == NULL)
        {
-         /* FIXME: We need to trap errors, since XINERAMA isn't always XINERAMA.
-          *        I don't think the num_monitors <= 0 check has any validity.
-          */ 
-         g_error ("error while retrieving Xinerama information");
+         /* If Xinerama doesn't think we have any monitors, try acting as
+          * though we had no Xinerama. If the "no monitors" condition
+          * is because XRandR 1.2 is currently switching between CRTCs,
+          * we'll be notified again when we have our monitor back,
+          * and can go back into Xinerama-ish mode at that point. */
+         if (monitors)
+           XFree (monitors);
+         return FALSE;
        }
       else
        {